﻿using B.S.DataBase.Domain;
using B.S.DataBase.ErrorCode;
using B.S.DataBase.MyProject.Domain;
using B.S.DataBase.MyProject.ErrorCode;
using B.S.DataBase.Read.API.Appicant.Command.TrunMeonCommand;
using B.S.DataBase.Read.API.DTOs;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.DataBase.Read.API.Controllers
{
    /// <summary>
    /// 审批
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class TrunMeonController : ControllerBase
    {

        private readonly IMediator mediator;


        public TrunMeonController(IMediator mediator)
        {
            this.mediator = mediator;
        }


        /// <summary>
        /// 查询部门的管理者
        /// </summary>
        /// <param name="get"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<List<User>>> Login([FromQuery]GetMeonCommand get)
        {
            return await mediator.Send(get);
        }


        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<APIPing<TrunMeon>>> FGetTrun([FromQuery]listMeonCommand list)
        {
            return await mediator.Send(list);
        }
    }
}
